# 属性
# 这个是每次new都是一份数据
class Dog():
    tooth = 10
    pass


dog1 = Dog()
dog2 = Dog()
print('-----------------类属性,通过类对象修改,就是类属性,---------------')
# 类属性
Dog.tooth = 12
print(Dog.tooth)
print(dog1.tooth)
print(dog2.tooth)
print('-----------------类属性,如果实例对象修改了类属性,创建了一个实例属性---------------')

# 这个属于实例属性,每个实例都会新的一份
dog1.tooth = 2
print(dog1.tooth)
print(dog2.tooth)
print(Dog.tooth)

Dog.tooth = 20
print(Dog.tooth)
print(dog1.tooth)
print(dog2.tooth)

print('-----------------实例属性---------------')


class Dog():
    def __init__(self):
        self.age = 5
        pass

    def info_print(self):
        print(self.age)
        pass

    pass


dog1 = Dog()
# $ 5
print(dog1.age)
# 5
dog1.info_print()
